/**
 * MainPage View
 * @author helio
 */
if (!SALE.MainPage) SALE.MainPage = Ext.extend(Ext.Panel, {
        layout: 'border',
		border: false,
        initComponent: function(){
        	this.headerPanel = new Ext.BoxComponent({
			    region: 'north',
			    el: 'north',
			    height: 60
			});
			
			this.menuPanel = new Ext.Panel({
			    region: 'west',
			    id: 'west-panel',
			    title: '系统菜单',
			    split: true,
			    width: 200,
			    minSize: 170,
			    maxSize: 400,
			    collapsible: true,
			    margins: '0 0 5 5',
			    layout: 'accordion',
			    layoutConfig: {
			        animate: false
			    },
			    items: [{
			        contentEl: 'task-vidition',
			        title: '销售业务管理',
			        border: false,
			        iconCls: 'icon-menu-sale'
			    }, {
			        title: '销售统计分析',
			        contentEl: 'task-statistics',
			        border: false,
			        iconCls: 'icon-menu-chart'
			    }, {
			        title: '采购业务管理',
			        contentEl: 'task-purchase',
			        border: false,
			        iconCls: 'icon-menu-purchase'
			    }, {
			        title: '库存管理',
			        contentEl: 'task-storage',
			        border: false,
			        iconCls: 'icon-menu-stocks'
			    }, {
			        title: '钱帐管理',
			        contentEl: 'task-money',
			        border: false,
			        iconCls: 'icon-menu-money'
			    }, {
			        title: '基本数据编辑',
			        contentEl: 'task-basedata',
			        border: false,
			        iconCls: 'icon-menu-basic'
			    }, {
			        title: '系统管理',
			        contentEl: 'task-system',
			        border: false,
			        iconCls: 'icon-menu-manage'
			    }]
			});
			
			this.realTimeView = new RealTimeInfoView();				
			this.realTimeView.initDetailsJson();
			
			this.centerPanel = new Ext.TabPanel({
			    region: 'center',
			    deferredRender: false,
			    activeTab: 0,
			    margins: '0 5 5 0',
			    items: [{
					title: '及时信息',
					autoScroll: true,
					border: false,
					layout: 'fit',
					iconCls: 'icon-tab-welcome',
					items : this.realTimeView.getCorePanel()
				}, {
			        title: '系统说明',
					iconCls: 'icon-tab-guid',
			        autoScroll: true,
			        bodyStyle: "padding: 10px",
			        autoLoad: {
						url: "html/descri.html"
					}
			    }]
			});
            this.items = {
                region: 'center',
                //id: 'cardstack',
                layout: 'border',
                items: [this.headerPanel, this.menuPanel, this.centerPanel]
            };
            
            SALE.MainPage.superclass.initComponent.call(this);
        }
    });

Ext.reg('mainpage', SALE.MainPage);